package com.kaesar.thread_ressmix;

/**
 * 创建多线程的第一种方式：继承Thread类
 *
 * @Author: chengk
 * @Date: 2021/8/19 9:49 下午
 */
public class MyThread extends Thread {
    @Override
    public void run() {
        for (int i = 0; i < 10000; i++) {
            System.out.print(i + " ");
        }
        System.out.println();
    }

    public static void main(String[] args) {
        MyThread t = new MyThread();
        t.start(); // 启动子线程

        System.out.println();
        // 主线程继续同时向下执行
        for (int i = 0; i < 10000; i++) {
            System.out.print(i + " ");
        }
    }
}
